public class Ball {
    private int x;
    private int y;
    private int diameter;
    private int dx = 2;
    private int dy = -2;
    
    public Ball(int x, int y, int diameter) {
        this.x = x;
        this.y = y;
        this.diameter = diameter;
    }
    
    public void move() {
        x += dx;
        y += dy;
    }
    
    public void reverseX() {
        dx = -dx;
    }
    
    public void reverseY() {
        dy = -dy;
    }
    
    public int getX() {
        return x;
    }
    
    public int getY() {
        return y;
    }
    
    public int getDiameter() {
        return diameter;
    }
    
    public java.awt.Rectangle getBounds() {
        return new java.awt.Rectangle(x, y, diameter, diameter);
    }
}    